package com.ruoyi.regulatory.service;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.regulatory.domain.JySchoolClassHistory;
import com.ruoyi.regulatory.mapper.JySchoolClassHistoryMapper;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 学校班级Service业务层处理
 *
 * @author ruoyi
 * @date 2024-05-25
 */
@Service
@RequiredArgsConstructor
public class JySchoolClassHistoryService {
    private final JySchoolClassHistoryMapper jySchoolClassHistoryMapper;

    /**
     * 查询学校班级
     *
     * @param id 学校班级主键
     * @return 学校班级
     */
    public JySchoolClassHistory selectJySchoolClassHistoryById(Long id) {
        return jySchoolClassHistoryMapper.selectJySchoolClassHistoryById(id);
    }

    /**
     * 查询学校班级列表
     *
     * @param jySchoolClassHistory 学校班级
     * @return 学校班级
     */
    public List<JySchoolClassHistory> selectJySchoolClassHistoryList(JySchoolClassHistory jySchoolClassHistory) {
        return jySchoolClassHistoryMapper.selectJySchoolClassHistoryList(jySchoolClassHistory);
    }

    /**
     * 新增学校班级
     *
     * @param jySchoolClassHistory 学校班级
     * @return 结果
     */
    public int insertJySchoolClassHistory(JySchoolClassHistory jySchoolClassHistory) {
        jySchoolClassHistory.setCreateTime(DateUtils.getNowDate());
        return jySchoolClassHistoryMapper.insertJySchoolClassHistory(jySchoolClassHistory);
    }

    /**
     * 修改学校班级
     *
     * @param jySchoolClassHistory 学校班级
     * @return 结果
     */
    public int updateJySchoolClassHistory(JySchoolClassHistory jySchoolClassHistory) {
        jySchoolClassHistory.setUpdateTime(DateUtils.getNowDate());
        return jySchoolClassHistoryMapper.updateJySchoolClassHistory(jySchoolClassHistory);
    }

    /**
     * 批量删除学校班级
     *
     * @param ids 需要删除的学校班级主键
     * @return 结果
     */
    public int deleteJySchoolClassHistoryByIds(Long[] ids) {
        return jySchoolClassHistoryMapper.deleteJySchoolClassHistoryByIds(ids);
    }

    /**
     * 删除学校班级信息
     *
     * @param id 学校班级主键
     * @return 结果
     */
    public int deleteJySchoolClassHistoryById(Long id) {
        return jySchoolClassHistoryMapper.deleteJySchoolClassHistoryById(id);
    }
}
